const boxes = document.querySelectorAll(".box");
window.onload = boxShow();
window.addEventListener("scroll",() => {
    boxShow()
});

function boxShow() {
    const triggle = window.innerHeight * 0.8;
    boxes.forEach(box => {
        const boxTop = box.getBoundingClientRect().top;
        if (boxTop < triggle) {
            box.classList.add("show");
        }else {
            box.classList.remove("show");
        }
    });
}